var _ = require('ramda');
// function curry<(start: any, test: any, update: any, body: any) => void>(f: (start: any, test: any, update: any, body: any) => void): Curry<(start: any, test: any, update: any, body: any) => void>
// var loop: Curry<(start: any, test: any, update: any, body: any) => void>

var loop = _.curry(function (start, test, update, body) {
    for(let val=start;test(val);val=update(val)){
        body(val)
    }
});


loop(3, n => n > 0, n => n - 1, console.log);